<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="generator" content="PHPDoctor 2RC4 (http://peej.github.com/phpdoctor/)">
<meta name="when" content="Mon, 02 May 2011 02:46:56 +0000">

<link rel="stylesheet" type="text/css" href="../stylesheet.css">
<link rel="start" href="../overview-summary.html">

<title>browser.php (Cornice)</title>

</head>
<body id="file" onload="parent.document.title=document.title;">

<div class="header">
<h1>Cornice</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li><li>Class</li><li>Tree</li><li><a href="../overview-files.html">Files</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../todo-list.html">Todo</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../source\browser.php.html" target="_top">No frames</a>
</div>
<hr>

<h1>browser.php</h1>
<div class="comment" id="overview_description"><p>============================================================================ * Cornice PHP Framework & Website Builder * Freeware (f) 2011 by Inforo Software & Computer *============================================================================</p></div>

<hr>

<a name="line1"></a><pre><?php/** *============================================================================ * Cornice PHP Framework & Website Builder * Freeware (f) 2011 by Inforo Software & Computer *============================================================================ */ /** * Class to be used like a hidden browser * @author Nicola Dinh * @version 2011.04.2901 */class browser {  /**   * Default instance level constructor   */  public function __construct() {    //  }    /**   * Read a web page, returns HTML of page & error if there is,   * reference: http://uk.php.net/manual/en/function.curl-getinfo.php   * @param string $url The full URL to certain web page   * @return array The array containing HTML or error   */  public static function get_web_page($url) {   $options = array(      CURLOPT_RETURNTRANSFER => true,     //return web page      CURLOPT_HEADER         => false,    //don't return headers      CURLOPT_FOLLOWLOCATION => true,     //follow redirects      CURLOPT_ENCODING       => "",       //handle all encodings      CURLOPT_USERAGENT      => "Spider", //who am i      CURLOPT_AUTOREFERER    => true,     //set referer on redirect      CURLOPT_CONNECTTIMEOUT => 120,      //timeout on connect      CURLOPT_TIMEOUT        => 120,      //timeout on response      CURLOPT_MAXREDIRS      => 10,       //stop after 10 redirects    );    $ch      = curl_init($url);    curl_setopt_array($ch,$options);        $content = curl_exec($ch);    $err     = curl_errno($ch);    $errmsg  = curl_error($ch);    $header  = curl_getinfo($ch); //see php.net "curl_getinfo" function    curl_close($ch);    $header["errno"]   = $err;    $header["errmsg"]  = $errmsg;    $header["content"] = $content;    return $header;    }//get_web_page}</pre>
<div class="header">
<h1>Cornice</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li><li>Class</li><li>Tree</li><li><a href="../overview-files.html">Files</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../todo-list.html">Todo</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../source\browser.php.html" target="_top">No frames</a>
</div>
<hr>

<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>

</body>

</html>